package com.shujia.day04;

public class Student {
    private String name;
    private int age;
    private String gender;

    public void setName(String inName) {
        name = inName;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setGender(String inGender) {
        if (inGender.equals("男") || inGender.equals("女")){
            gender = inGender;
        }else {
            System.out.println("性别只能为男或女，您输入的信息不正确...");
        }
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public void printInfo() {
        System.out.println("我叫：" + name + " 今年：" + age + " 性别是:" + gender);
    }

}
